<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Cherry Editor - Markdown Editor</title>
    <style>
      html,
      body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: hidden;
      }
    </style>
    <link rel="stylesheet" type="text/css" href="../packages/cherry-markdown/dist/cherry-markdown.css" />
    <link rel="Shortcut Icon" href="./logo/favicon.ico" />
    <link rel="Shortcut Icon" href="../logo/favicon.ico" />
    <link rel="Bookmark" href="../logo/favicon.ico" />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css"
      integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X"
      crossorigin="anonymous"
    />
  </head>

  <body>
    <div id="dom_mask" style="position: absolute; top: 40px; height: 20px; width: 100%"></div>
    <div id="markdown"></div>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@4.6.0/dist/echarts.js"></script>
    <!--<script src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>-->
    <script src="../packages/cherry-markdown/dist/cherry-markdown.js"></script>
    <script src="./assets/scripts/notoolbar-demo.js"></script>
    <script type="module">
      // 使用 fetch 获取 markdown 文件内容
      const response = await fetch('./assets/markdown/index.md');
      const basicMd = await response.text();
      import { noToolbarConfig } from './assets/scripts/notoolbar-demo.js';
      // 在Vite中使用?raw导入的文件内容已经是字符串，无需通过fetch获取
      const config = Object.assign({}, noToolbarConfig, { value: basicMd });
      window.cherry = new Cherry(config);
    </script>
  </body>
</html>
